local FightInterface = require("gameLogic.fightSkill.sequence.FightInterface")
local FightActorAction = class("FightActorAction", FightInterface)
local AnimConst = require("const.AnimConst")

function FightActorAction:ctor(actor, action)
    self._actor = actor
    self._action = action
    FightActorAction.super.ctor(self)
end

function FightActorAction:_update()
    if self._sequence then
        return
    end
    local actionTime = self._actor:getAnimationLength(AnimConst.ACTION_MAP_CLIP[self._action])
    self._actor:playAction(self._action)
    self._sequence = DOTween.Sequence()
    self._sequence:AppendInterval(actionTime)
    self._sequence:AppendCallback(
        function()
            self._isDone = true
        end
    )
end

return FightActorAction
